<?php 
	$customerid=Mage::getSingleton('customer/session')->getCustomerId();
	$isPartner= Mage::getModel('marketplaceprofile/marketplaceprofile')->isPartner($customerid);
	if($isPartner==1): ?>
	
	
	<link href="<?php echo $this->getSkinUrl('Customerpartner/css').'/editproduct.css' ?>" rel="stylesheet" type="text/css" />
	<link href="<?php echo $this->getSkinUrl('Customerpartner/css').'/consistency.css' ?>" rel="stylesheet" type="text/css" />
	<link href="<?php echo $this->getSkinUrl('Customerpartner/js/chosen_v1.1.0/chosen.css'); ?>" rel="stylesheet" type="text/css" />
	<link href="<?php echo $this->getSkinUrl('Customerpartner/css/crop_css/imgareaselect-animated.css'); ?>" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		if (typeof jQuery == 'undefined'){
			document.write(unescape("%3Cscript src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
		}
	</script> 
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jquery-1.7.2.min.js'); ?>" type="text/javascript"></script>
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jquery-ui-1.8.21.custom.min.js'); ?>" type="text/javascript"></script>
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/pixastic.custom.js'); ?>" type="text/javascript"></script>
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/crop.js'); ?>" type="text/javascript"></script>	
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/chosen_v1.1.0/chosen.jquery.js'); ?>" type="text/javascript"></script>
	<script src="<?php echo $this->getSkinUrl('Customerpartner/js/ckeditor/ckeditor.js'); ?>" type="text/javascript"></script>
	
	
	<?php
	$mediaurl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
	$url= $_SERVER['REQUEST_URI'];
	$urlarr=explode('/id/',$url);
	echo $this->getMessagesBlock()->getGroupedHtml();
	$product = $this->getProduct();
	$productcity = Mage::getModel('catalog/product');
	$loadpro= $productcity->load($urlarr[1]);

    $pro_attributeset = $loadpro->getAttributeSetId();
    $switch_category = $loadpro->getBreadcrumb();
    $current_switch_category = explode(",",$switch_category);
    $cat=$loadpro->getCategoryIds();
    $mediaurl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
    $selected = Mage::getModel('catalog/category')->load($cat[0])->getName();
	$level1 = Mage::getModel('catalog/category')->load($cat[0])->getParentId();$level1_name = Mage::getModel('catalog/category')->load($level1)->getName();
	$level2 = Mage::getModel('catalog/category')->load($level1)->getParentId();$level2_name = Mage::getModel('catalog/category')->load($level2)->getName();
	$level3 = Mage::getModel('catalog/category')->load($level2)->getParentId();$level3_name = Mage::getModel('catalog/category')->load($level3)->getName();
	$level4 = Mage::getModel('catalog/category')->load($level3)->getParentId();$level4_name = Mage::getModel('catalog/category')->load($level4)->getName();
	if($level2 == '3'):
		$bread = $level1_name.' > '.$selected;	
	elseif($level3 == '3'):
		$bread = $level2_name.' > '.$level1_name.' > '.$selected;	
	elseif($level4 = '3'):
		$bread = $level3_name.' > '.$level2_name.' > '.$level1_name.' > '.$selected;	
	else:
		$bread = $level4_name.' > '.$level3_name.' > '.$level2_name.' > '.$level1_name.' > '.$selected;	
	endif;
    $optstate=$loadpro->getStates();
    $optcountry=$loadpro->getCountry();
    $currentstate = $loadpro->getAttributeText('state');
	$optcondition=$productcity->getCondition();
	$optcollection=$productcity->getCollectiontype();	
	$qtyStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($urlarr[1])->getQty();				
	$categories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->addIsActiveFilter();
	$allcatid = array();
	$k=0;
	foreach($categories as $c):
		$allcatid[$k] = $c->getId();
		$k++;
	endforeach;
	$finalcat=array_shift($allcatid);	
	?>
	<!-- proeviously used attrcodes -->
	<?php 
	$all=Mage::getModel('categoryattribute/categoryattribute')->getCollection();
	$usedatrcode=array();
	foreach($all as $a):
		//echo $a['attribute_code'];  
		$datas=$loadpro->getData($a['attribute_code']);
		if($datas!=''):
			array_push($usedatrcode, $a['attribute_code']);
		endif;
	endforeach;
	$usedatrcode=array_unique($usedatrcode);
	$usedcodes=implode(",", $usedatrcode);

	?>
	<!-- eof proeviously used attrcodes -->
	<?php 
	/* finding seller product */
	
	$sid=Mage::getModel('marketplacepartner/marketplacepartner')->isProductId($urlarr[1]);
	if($sid != $customerid):
		$newUrl=Mage::getBaseUrl().'marketplacepartner/partnerproducts/myproductslist/';
	?>
	<script type="text/javascript">location.href ='<?php echo $newUrl ?>';</script>
	<?php else: ?>
    <div class="my-account-edit-product">
		<div class="my-account my-acc-editprod" >
		<form action="<?php echo $this->getUrl('seller/partnerproducts/editapprovedsimple') ?>" enctype="multipart/form-data" method="post" id="form-customer-product-editPost">
			<input type="hidden" id="js-pro_id" name="productid" value="<?php echo $urlarr[1]; ?>" />
			<input type="hidden" id="categoryid" value="" /> 
			<input type="hidden" id="js-attributeset" name="attribute_set_id" value = "<?php echo $pro_attributeset; ?>" />
			<input type="hidden" id="js-switch_category" value="<?php echo $current_switch_category[1]; ?>" />
			<input type="hidden" id="js-subcategoryid" value="<?php echo $cat[0]; ?>" /> 
			<input type="hidden" name="switch_cat" id="edit_switch_category" value="" />
			<input type="hidden" name="breadcrumb" id="js-breadcrumbs" value="<?php echo $loadpro->getBreadcrumb(); ?>" />
			<input type="hidden" id="js-select_country" value="<?php echo $currentstate; ?>" />
			<input type="hidden" id="discount" value="<?php echo $loadpro->getDiscount(); ?>" name="discount" />
			<input type="hidden" value="" id="js-swi" />
			<input type="hidden" value="<?php echo $usedcodes ?>" name="usedcodes" />
			<div class="title-box">
					<h2><?php echo Mage::helper('marketplacepartner')->__('Edit your Product') ?></h2>
					 <span class="introtext" style="margin-left: 5px;font-size:13px;"> Edit product information and photographs of the items you wish to sell.</span>
			</div>
			<div class="group-select field_margin">
				<div id="customerpartner-products">      
					<div class="fieldgroup js-field1" id="js-edit_field1">
						<b>
							<h2 class="fieldtitles" >Where is the product available ?</h2>
						</b>
						<span class="introtext">This is your address from your Address Book. Check the Edit location box to edit the location.</span><br /><br />
						<ul>					
							<li>
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Country')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<div style="float:right">
									<select name="country" id="js-country" class="prodinput">
					                     <?php $country_list = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false) ?>
												<?php if (count($country_list) > 0): ?>
														<option value="">Please Select</option>
														<?php foreach($country_list as $country): ?>
																<?php if($country['value']=='CA' || $country['value']=='US'):
																		?>
																		<?php if($optcountry==$country['label']):?>
																			<option selected="selected" value="<?php echo $country['label'] ?>" id="<?php echo $country['value'] ?>">
																				<?php echo $country['label']; ?>
																			</option>
																	   <?php else: ?>
																	   		<option value="<?php echo $country['label']; ?>" id="<?php echo $country['value']; ?>"><?php echo $country['label']; ?></option>
																	   <?php endif; ?>
																<?php endif; ?>
														<?php endforeach; ?>
												<?php endif; ?>  
					               	</select>
								</div>
							</li>							
							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('State')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								
									<select name="state" id="js-state" class="prodinput"> </select>
								
							</li>

							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('City')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								
								
									<input class="prodinput" type="text" name="city" id="js-city" value="<?php echo $loadpro->getAttributeText('city'); ?>" />															
							</li>
							<li>								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Zip code') ?>  </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								
									<input type="text" name="zip" id="js-zip" class="prodinput" value="<?php echo $loadpro->getZip();?>"/>
								
							</li>
							<li>
								<div class="locandcatcheck">
									<input type="checkbox" value="location" id="js-location">Edit location
								</div>														
						    </li>	
							
						</ul>
					</div>
					<div class="fieldgroup field2" id="edit_field2"><b><h2 class="fieldtitles" >Type of collection and product category</h2></b>
						<span class="introtext">Tell us where what type of collection and category your product belongs to.</span><br /><br />
					    <ul>
						    
							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Collection') ?></h1><span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<input type="hidden" name="collectiontype" id="collectiontype" />
								<select id="js-collection" class=" required-entry prodinput" name="collectiontype">   
										<?php if($optcollection=="616"):?>
												<option selected="selected" value="616">Mall Collection</option> 
												<option value="615">Personal Collection</option>					   							
												<?php else: ?>
												<option value="616">Mall Collection</option>
												<option selected="selected" value="615">Personal Collection</option> 
											<?php endif;?>
					    			
								</select>
								
							</li>
							<li class='js-mall'>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Mall name')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								
								
									<input type="mall" class="required-entry prodinput modify" name="mall" id="mall" value="<?php echo $loadpro->getAttributeText('mall'); ?>" />
								
							</li>
							<li class='js-mall'>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Store name')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<input type="retailstore" class="required-entry modify prodinput" name="retailstore"  id="retailstore" value="<?php echo $loadpro->getAttributeText('retailstore'); ?>" />
							</li>

							<li class='js-home'>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Condition')?> </h1> <span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<select class="required-entry prodinput" name="condition" id="js-condition">
					                	<?php  
					                    	 	$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'condition');
					               			 foreach ($attribute->getSource()->getAllOptions(true, true) as $option): ?>
					               			 	<?php  $optcon=$option['value'];
					                					if($optcondition==$optcon):?>
					                						<option selected="selected" value="<?php echo $option['value']; ?>">
					                    						<?php echo $option['label']; ?>
					                   				   </option><?php else: ?>
					                   			 		<option value="<?php echo $option['value']; ?>">
					                    						<?php echo $option['label']; ?>
					                    					</option><?php endif; ?>
					                    
					            		<?php endforeach; ?>
								</select>
								
							</li>

							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Selected Category') ?></h1>						
								<input type="breadcrumb" class="prodinput" name="breadcrumbs" disabled="true" id="breadcrumb" value="<?php echo $bread;?>"/>
							 	
							</li>		

							<li>
								<div class="locandcatcheck">
									<input type="checkbox" value="categorychange" id="js-cat_change">Change Category
								</div>							
							</li>

							<li class='js-categorychange'>
									
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Select a category') ?></h1><span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
									
							</li>
						
							<li class='js-categorychange'>
								<ul style="margin:0px 160px;width: 700px;">										
									<li style="float:left"><select size="3" id="js-category" name="category" class="js-stylecategory" level="sub1cat" style="height:151px;">
								 		<?php $_helper = Mage::helper('catalog/category') ?>
											<?php $_categories = $_helper->getStoreCategories() ?>		 
											<?php $currentCategory = Mage::registry('current_category') ?>
											<?php if (count($_categories) > 0): ?>		           
							                <?php foreach($_categories as $_category): ?>
													<option value="<?php echo $_category->getId() ?>" id=""><?php echo $_category->getName().' > '; ?></option>
												<?php endforeach; ?>
											<?php endif; ?>						   						
										</select>
									</li>										
									<li style="float:left"><select style="height:151px;" size="3" id="js-sub1cat" level="sub2cat" name="category" class="js-stylecategory" style="padding:3.5px;"> </select></li>
									<li style="float:left"><select style="height:151px;" size="3" id="js-sub2cat" level="sub3cat" name="category" class="js-stylecategory" style="padding:3.5px;"> </select></li>
									<li style="float:left"><select style="height:151px;" size="3" id="js-sub3cat" level="sub4cat" name="category" class="js-stylecategory" style="padding:3.5px;"> </select></li>								
								</ul>	
							</li>
							<li >
									<h1 class="js-selected_msg"></h1>
						   	</li>
							
						</ul>
					</div>
					<div class="fieldgroup field2" id="edit_field33"><b><h2 class="fieldtitles" >Name of the product</h2></b>
						<span class="introtext">The name of the product that you enter here will be the name displayed in the mall140 catalog.</span><br /><br />
						<ul>
						    
					    	<li>
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Product Name')?> </h1> 
								<span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<input type="name" class="required-entry prodinput modify" name="name" id="name" onfocus="return namefocus()" value="<?php echo $loadpro->getName(); ?>" maxlength="150"/>
								
							</li>
							
						</ul>
					</div>
					<div class="fieldgroup field3" id="simple_field3">
						<b><h2 class="fieldtitles prodet" >Product details </h2></b>
						<div><img class="loader js-autofieldsload" src="http://m2085.sgded.com/~mall1408/beta/skin/frontend/default/mall-market/images/loading.gif " style="display:none"/></div>
						<ul class="js-autofields autofields">
					        															
						</ul>
					</div>
					<div class="fieldgroup field2" id="edit_field4"><b><h2 class="fieldtitles" >Price & Quantity</h2></b>
						<span class="introtext">Enter the price for one product and the number of products available with you.</span><br /><br />
					    <ul>
						    
						<?php if($optcollection=="616"):?>
					<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Retail Price')?> </h1> 
							
							
								<input type="cost" class="prodinput number js-no-check" title="In-Store Price" name="retailprice" id="js-cost" value="<?php echo (int)$loadpro->getRetailprice();  ?>" />
								
					
							</li>
							<li><h1 class="js-no-msg ermsg" name="retailprice"> </h1></li>	    

					<?php else: ?>
							
					
					<?php endif; ?>

							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Actual Price') ?> </h1>
									
								<input type="msrp" class="prodinput number js-no-check" title="Regular Price" name="msrp" id="js-msrp" value="<?php echo (int)$loadpro->getMsrp(); ?>"/>
								
								
							</li>
							<li><h1 class="js-no-msg msrp_comm ermsg" name="msrp" > </h1></li>
								<li>
							
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Your Price') ?> </h1><span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
									
								<input type="price" class=" required-entry prodinput number js-no-check" title="Your Price" name="price" id="js-price" value="<?php echo (int)$loadpro->getPrice(); ?>"/>
							  
								
							</li>
							<li> <h1 id="js-commission ermsg"> </h1>
							   <h1 class="js-no-msg js-price_comm ermsg" name="price"> </h1></li>
							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Quantity') ?> </h1><span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span>
									
								<input type="stock" class=" required-entry prodinput js-no-des" title="Quantity" name="stock" id="js-stock" value="<?php echo (int)$qtyStock; ?>"/>
								
							
							</li>
							<li>
							<h1 class="des-msg ermsg" name="stock" > </h1>
							</li>
							<li>
								
								<h1 class="topic_weight"><?php echo Mage::helper('marketplacepartner')->__('Weight per item') ?> (in pounds)</h1>
								
							
								<input type="weight" class="prodinput number no-des" name="weight" title="Weight" id="js-weight" value="<?php echo (int)$loadpro->getWeight(); ?>"/>
								
								
							</li>
							<li><h1 class="des-msg ermsg" name="weight" > </label></li>
							<li>
								
								<h1 class="topic"><?php echo Mage::helper('marketplacepartner')->__('Description') ?> </h1>
								<span class="required starimp">&nbsp;&nbsp;&nbsp;&nbsp;</span><br>
								(Please describe the item briefly)
										
								<textarea name="description" class="required-entry prodinput" id="description" rows="5" cols="75" style="width:522px; background-color:white;"><?php echo $loadpro->getDescription(); ?></textarea>
								<span class="introtext"> Min: 20 characters Max: 1500 characters </span><br />
								<span class="descerrmsg"></span>
							</li>
							
						</ul>
					</div>
					<fieldset class="fieldgroup field2" id="edit_field5"><b><h2 class="fieldtitles" >Upload product pictures</h2></b>
						<span class="introtext">The pictures you upload here will be displayed in the mall140 catalog.</span>
							<ul class="image_gallery">
                        <?php                       
                        	$editfolder = getcwd()."/beta/media/edit";
                        	if(!file_exists($editfolder)){
                        		mkdir($editfolder,0777,true);
                        	} 
                            $uniqid = uniqid();
                            $_images=Mage::getModel('catalog/product')->load($loadpro->getId())->getMediaGalleryImages();
                            $images_count = count($_images);
                            $img_loc = getcwd()."/beta/media/edit/";
                            $temp=1;
                            $imgname_start = $customerid.$uniqid;
                            foreach($_images as $_image){
                                $file = $_image->getFile();                                   
                                $image = new Imagick();
                                $image->readImage($this->helper('catalog/image')->init($loadpro,'thumbnail',$_image->getFile()));
                                $width = $image->getImageWidth();
                                $height = $image->getImageHeight();
                                $newwidth=ceil($width/$height*100);//image width to show in product edit page
                                $newheight=ceil($height/$width*100);//image width to show in product edit page
                                if($newheight>100){
                                    $newheight=100;
                                }
                                if($newwidth>100){
                                    $newwidth=100;
                                }
                                if($newheight!=100){
                                    $top=ceil((100-$newheight)/2);//margin-top for center alignment of image
                                }
                                else {
                                    $top=0;
                                }
                                $imgname = $imgname_start."_".$temp.".jpg";
                                $current = $img_loc.$imgname;
                                $image->writeImage($current);
                                $current_data = base64_encode(file_get_contents($current));
                                $current_data = 'data:image/png;base64,'.$current_data;
                                $current = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."edit/".$imgname;
                        ?>
                                <li class="imgli">
                                    <div class='img_block<?php echo $temp;?>'>                               
                                    <div class="def_imgdiv">
                                        <img match="<?php echo ($temp==1)?'base_image':('thumb_image'.($temp-1)); ?>" id="pro-img_<?php echo $temp ?>" src="<?php echo $current_data; ?>" class="add_img" style="cursor:pointer;width:<?php echo $newwidth ?>px;height:<?php echo $newheight ?>px;margin-top:<?php echo $top ?>px;" data-count=<?php echo $temp ?> data-src="<?php echo $current ?>" />
                                    </div>
                                    <br/>
                                    <input type="button" class="bt1 btn_upload topopup mainedit margin-r20" value="Edit" name="pro-img_<?php echo $temp ?>" match="<?php echo ($temp==1)?'base_image':('thumb_image'.($temp-1)); ?>"  />                                  
                                    <input type="file" id="file_pro-img_<?php echo $temp ?>"  name="images<?php echo $temp ?>" class="file_add_img hide " name_id="pro-img_<?php echo $temp ?>" >

                                    <!--<input id="del-pro-img_<?php echo $temp ?>" name="del-img_<?php echo $temp ?>" value="<?php echo $_image->getFile(); ?>" style="display:none;" />  --> 
                                    </div>
                                    <div class="up_div hide img_load<?php echo $temp;?>">
                                        <div class="up_load"></div>
                                        <div>Uploading </div>
                                    </div>      
                                </li>
                        <?php
                                $temp++;
                            }
                            #Mage::log("Images count:".$images_count);
                            #Mage::log("img_loc:".$img_loc);
                            $count = $images_count;
                            $remain = 5 - $count;
                            for($temp = $count+1; $temp <= 5; $temp++){
                        ?>
                                <li class="imgli">
                                    <div class='img_block<?php echo $temp;?>'>    
                                    <div class="def_imgdiv">
                                        <img match="<?php echo ($temp==1)?'base_image':('thumb_image'.($temp-1)); ?>"  style="cursor:pointer" id="pro-img_<?php echo $temp ?>" src="<?php echo $mediaurl.'avatar/'.'default_img.jpg'; ?>"  width="100" height="100" class="add_img" data-count=<?php echo $temp ?> data-src="<?php echo $mediaurl.'avatar/'.'default_img.jpg'; ?>" />
                                    </div>
                                    <br/>
                                    <input type="button" class="bt1 btn_upload topopup mainedit margin-r20" value="Edit" name="pro-img_<?php echo $temp ?>" match="<?php echo ($temp==1)?'base_image':('thumb_image'.($temp-1)); ?>"  />                                  
                                    <input type="file" id="file_pro-img_<?php echo $temp ?>"  name="images<?php echo $temp ?>" class="file_add_img hide " name_id="pro-img_<?php echo $temp ?>" >
                                    <!--<input id="del-pro-img_<?php echo $temp ?>" name="del-img_<?php echo $temp ?>" value="" style="display:none;"/>     -->
                                    </div>
                                    <div class="up_div hide img_load<?php echo $temp;?>">
                                        <div class="up_load"></div>
                                        <div>Uploading </div>
                                    </div>                             
                                </li>
                        <?php
                            }
                        ?>
                        <input type="hidden" id="name_id" name="image_name" value="<?php echo $imgname_start; ?>"/>
                        </ul>
					</fieldset>
				</div>		
<!-- ********************************************************************************************************************************************************** -->
				<input type="hidden" class="pix" name="base" id="i1" />
		 		<input type="hidden" class="pix" name="thumbs1" id="i2" />
		 		<input type="hidden" class="pix" name="thumbs2" id="i3" />
		 		<input type="hidden" class="pix" name="thumbs3" id="i4" />
		 		<input type="hidden" class="pix" name="thumbs4" id="i5" />
				<div class="button-set edit_buttonarea">
					<button id="save" type="submit" class="btn_upload2 btn1" onclick="return Check();"><span><?php echo Mage::helper('marketplacepartner')->__('Save') ?></span></button>
					<div id="imgupload" style="display:none;left: 60%;margin-top: 0px;position: absolute;width: 200px;">
                        <div class='imgload'></div>
                        <div style="float: right;">Please wait..Image is Uploading...</div>
                    </div>
				</div>
			</div>
		</form>
	</div>
	</div>
</div>
<div id="toPopup">
     <div class="close"></div>
		<div id="popup_content">
			<h2 class="pop_close"></h2>					
			<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('customer/image_editing.phtml')->toHtml(); ?>
		</div>
</div> 

<?php endif; ?>
<!--
end new product
-->
<input type="hidden" class="js-jqurls" value="<?php echo Mage::getBaseUrl(); ?>" id="js-upldbaseurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/country') ?>" id="js-edtctryurl" />
<input type="hidden" class="jqurls" value="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);?>" id="js-edtmediaurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/editcategoryattributes') ?>" id="js-edtedictgurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/categoryselect') ?>" id="js-edtctgslcturl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/attributeset') ?>" id="js-edtattrslcturl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/verifyzip') ?>" id="js-edtvrfzipurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/addressvalid') ?>" id="js-edtadrsvldurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/state') ?>" id="js-edtstateurl" />
<input type="hidden" value="<?php echo $this->getUrl('seller/editproduct/Autofilling') ?>" id="js-edtautofillurl" />

<script type="text/javascript">
var newCustomerProductForm = new VarienForm('form-customer-product-editPost', true);
</script>
<script>
CKEDITOR.replace('description');//for ckeditor
CKEDITOR.instances.description.on("key", function (e)
{
    
	var editorText = CKEDITOR.instances.description.getData();
	var p = e.data.keyCode;

	if(editorText.length>=1500)
	{
		if(p =='46' || p == '8' || p=='35' || p == '36')
		{
		//delete=46;backspace=8;end=35;home=36  			
		}
		else
		{
			return false;

		}
	}

});
</script>
<script>
function Check()
{
	var editorText = CKEDITOR.instances.description.getData();
	var desctext = jQuery(editorText).text();
	var length = desctext.length;
	var ret = BaseImagecheck(length);
	return ret;
}
</script>

<?php else:
	echo Mage::helper('marketplacepartner')->__("<h2 style='color:#ff0000;font-weight:600'>FOR BECOME SELLER CONTACT TO ADMIN..</h2>");
endif;?>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js').'/editproduct.js' ?>" type="text/javascript"></script>


